import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite';
import Components from 'unplugin-vue-components/vite';
import { VantResolver } from '@vant/auto-import-resolver';

// import webfontDownload, { viteWebfontDownload } from 'vite-plugin-webfont-dl';
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    // webfontDownload([
    //   'https://fonts.googleapis.com/css2?family=Noto+Sans+SC&display=swap',
    // ]),
    // viteWebfontDownload([
    //   'https://fonts.googleapis.com/css2?family=Noto+Sans+SC&display=swap'
    // ],  {
    //   injectAsStyleTag: false,
    //   minifyCss: true,
    //   async: true,
    //   cache: true,
    //   proxy: false,
    // }),
    vue(),
    AutoImport({
      resolvers: [VantResolver()],
    }),
    Components({
      resolvers: [VantResolver()],
    }),
  ],
  resolve: {
    alias: {
      '@': '/src',
      // 这里可以添加更多的别名
      // 例如: 
      // 'components': '/src/components',
      // 'utils': '/src/utils',
    },
  }
})
